﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MesGLApp.DAL.MesDB
{
    /// <summary>
    /// 异常订单
    /// </summary>
    [Table("excep_order")]
    public class ExcepOrder
    {
        /// <summary>
        /// ID，主键自增长
        /// </summary>
        [Column("id"),Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ID { get; set; }

        /// <summary>
        /// 检修单号
        /// </summary>
        [Column("repair_number")]
        public string RepairNumber { get; set; }

        /// <summary>
        /// 工单ID号
        /// </summary>
        [Column("target_id")]
        public int TargetID { get; set; }

        /// <summary>
        /// 工单单号
        /// </summary>
        [Column("prod_number")]
        public string ProdNumber { get; set; }

        /// <summary>
        /// 发生异常的站点号
        /// </summary>
        [Column("site_id")]
        public int SiteID { get; set; }

        /// <summary>
        /// 发生异常的站点名
        /// </summary>
        [Column("site_name")]
        public string SiteName { get; set; }

        /// <summary>
        /// 异常状态ID
        /// </summary>
        [Column("err_status_id")]
        public int ErrStatusID { get; set; }

        /// <summary>
        /// 异常状态名称
        /// </summary>
        [Column("err_status_name")]
        public string ErrStatusName { get; set; }

        /// <summary>
        /// 异常数量
        /// </summary>
        [Column("err_qty")]
        public decimal ErrQty { get; set; }

        /// <summary>
        /// 处理状态，0代表未接单；1代表已接单；2代表已修完；3代表已复检
        /// </summary>
        [Column("disp_status")]
        public int DispStatus { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Column("remark")]
        public string Remark { get; set; }

        /// <summary>
        /// 建档人
        /// </summary>
        [Column("create_user")]
        public string CreateUser { get; set; }


        /// <summary>
        /// 建档日期
        /// </summary>
        [Column("create_date")]
        public DateTime? CreateDate { get; set; }


        /// <summary>
        /// 接收人
        /// </summary>
        [Column("receive_user")]
        public string ReceiveUser { get; set; }


        /// <summary>
        /// 接单日期
        /// </summary>
        [Column("receive_date")]
        public DateTime? ReceiveDate { get; set; }


        /// <summary>
        /// 维修人
        /// </summary>
        [Column("repair_user")]
        public string RepairUser { get; set; }


        /// <summary>
        /// 维修已完成日期
        /// </summary>
        [Column("repair_date")]
        public DateTime? RepairDate { get; set; }


        /// <summary>
        /// 复检人
        /// </summary>
        [Column("inspect_user")]
        public string InspectUser { get; set; }


        /// <summary>
        /// 复检日期
        /// </summary>
        [Column("inspect_date")]
        public DateTime? InspectDate { get; set; }

        /// <summary>
        /// 工单的生产数量 
        /// </summary>
        [NotMapped]
        public decimal ProdQty { get; set; }
    }
}
